package com.note.service.impl;

import com.note.dao.NoteContentMapper;
import com.note.entity.NoteContent;
import com.note.service.NoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Created by XQ on 2017/6/15.
 */
@Service("NoteContent")
public class NoteServiceImpl implements NoteService {

    @Autowired
    NoteContentMapper noteContentMapper;

    /**
     * 插入一条note数据
     * @param noteContent
     * @return
     */
    @Override
    public void insert(NoteContent noteContent) {
        noteContentMapper.insert(noteContent);
    }

    /**
     * 查找一条记录的id
     * @param title
     * @return
     */
    @Override
    public NoteContent findNoteIdByTitle(String title) {
        return noteContentMapper.findNoteIdByTitle(title);
    }

    /**
     * 通过今天的时间查找今日的行程
     * @param date
     * @return
     */
    @Override
    public List<NoteContent> selectByTime(String date, String userAccount) {
        return noteContentMapper.selectByTime(date,userAccount);
    }
}
